package com.ydh.company.interceptor;


import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


public class LoginInterceptor implements HandlerInterceptor {

    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        // 判断是否登陆了
      /*  User user = (User) request.getSession().getAttribute("user");
        if(user == null){
            // 说明没有登陆
            // 没有登陆重定向到登陆页面
            response.sendRedirect("/login/page");
            return false;
        }*/
        // 放行
        return true;
    }
}
